include('shared.lua')

// Draw

function ENT:Draw()
	// Scale
	
	local Scale = self.Entity:GetNetworkedInt("Scale")

	// Update the scale
	
	if (Scale != 0) then
		self:UpdateScale(Scale)
	end
	
	// Draw the model
	
	self.Entity:DrawModel()
end

// Update scale

function ENT:UpdateScale(Scale)
	// Scale
	
	if (Scale > 1) then
		self.Entity:SetModelWorldScale(Vector(Scale, Scale, Scale))
		
		// Render
		
		local Min = Vector(-32 * Scale, -32 * Scale, -32 * Scale)
		local Max = Vector(32 * Scale, 32 * Scale, 32 * Scale)
		
		self.Entity:SetRenderBounds(Min * 2, Max * 2)
		
		// Setup bones
		
		self.Entity:SetupBones()
	end
end